using System;

namespace FrameworkBase
{
    public class BindableProperty<T> where T : IEquatable<T>
    {
        private T _value = default(T);

        public T Value
        {
            get
            {
                return _value;
            }
            set
            {
                if (!value.Equals(_value))
                {
                    _value = value;
                    
                    OnValueChanged?.Invoke(value);
                }
            }
        }

        public Action<T> OnValueChanged;
    }
}